package main

import (
	"fmt"
)

type user struct {
	name string
	password string
}

func checkpassword(u user,password string) bool {
	return u.password == password
}
func checkpassword2(u *user,password string) bool{
	return u.password == password
}
func main() {
	a := user{name:"wang",password:"1024"}
	b := user{"wang","1024"}
	c := user{name:"wang"}
	c.password = "1024"
	var d user
	d.name ="wang"
	d.password = "1024"

	fmt.Println(a,b,c,d)
	fmt.Println(checkpassword(a,"haha"))
	fmt.Println(checkpassword2(&a,"haha"))
}
